/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package iterators;
import IA.*;
import java.util.*;
/**
 *
 * @author Jeremy
 */
public class CookItemIterator implements Iterator<CookItem>{

    private ArrayList<CookItem> items;
    
    public CookItemIterator(ArrayList<CookItem> items) {
        this.items = (ArrayList<CookItem>)items.clone();
    }
    
    @Override
    public boolean hasNext() {
        return !items.isEmpty();
    }

    @Override
    public CookItem next() {
        return items.remove(0);
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
